-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Food vouchers complement in MX #211
Conversation
cavalle
commented
Oct 3, 2023
- Adds Food Vouchers complement to MX regime used to generate the CFDI's "ValesDeDespensa" complement.
- Related to the Fuel Account Balance complement (Fuel account balance complement to MX regime #210)
- The GOBL complements maps one by one to every node and field of the CFDI complement.
- Implements validations according to the constrains of the the ValesDeDespensa spec.
- Normalises all the amounts to the precision (2 decimals) specified in the ValesDeDespensa spec.
- Calculates the grand total.
) | ||
} | ||
|
||
func validateFoodVouchersEmployee(value interface{}) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, you don't need to manually validate here. You just define the func (fve *FoodVoucersEmployee) Validate() error
method and ensure the preceding structure includes the field definition:
validation.Field(&line.Employee),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! Addressed in cf73168
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! 👍
validation.Length(0, 20), | ||
), | ||
validation.Field(&fvl.IssueDateTime, cal.DateTimeNotZero()), | ||
validation.Field(&fvl.Employee, validation.Required), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great now 👍